package com.hifar.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hifar.plat.AopOption.Dict;
import com.hifar.validate.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * @author zhuWeiWei
 * @description 表基础字段
 * @date 2024/12/27 15:36
 */
@Data
@EqualsAndHashCode
@ApiModel("表基础字段")
public class BaseModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @ApiModelProperty(value = "ID")
    @TableId("ID")
    @NotBlank(groups = UpdateGroup.class, message = "id不能为空!")
    private String id;
    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    @TableField(fill = FieldFill.INSERT)
    private String tenantId;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer rowSort;

    /**
     * 密级
     */
    @ApiModelProperty(value = "密级")
    @Dict(dictCode = "hf_sys_datasecret")
    @TableField(fill = FieldFill.INSERT)
    private Integer secretLevel;

    /**
     * 更新用户ID
     */
    @ApiModelProperty(value = "更新用户ID")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateUserId;
    /**
     * 更新用户名称
     */
    @ApiModelProperty(value = "更新用户名称")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateUserName;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remarks;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    private String status;
    /**
     * 创建用户ID
     */
    @ApiModelProperty(value = "创建用户ID")
    @TableField(fill = FieldFill.INSERT)
    private String createUserId;
    /**
     * 创建用户名称
     */
    @ApiModelProperty(value = "创建用户名称")
    @TableField(fill = FieldFill.INSERT)
    private String createUserName;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 0未删除1已删除
     */
    @TableLogic
    @ApiModelProperty(value = "0未删除1已删除")
    @TableField(fill = FieldFill.INSERT)
    private String delFlag;
}
